library CorpsmanMedkit initializer init

	private function Trig_Medkit_Conditions takes nothing returns boolean
		return GetSpellAbilityId()=='Arej'
	endfunction

	private function Trig_Medkit_Actions takes nothing returns nothing
		local unit u = GetSpellTargetUnit()
		local integer i = GetUnitAbilityLevel(GetTriggerUnit(),'Ahea')
		call SetWidgetLife(u, GetWidgetLife(u)+(i*5.0) )
		call PolledWait(2.)
		call SetWidgetLife(u, GetWidgetLife(u)+(i*5.0) )
		call PolledWait(2.)
		call SetWidgetLife(u, GetWidgetLife(u)+(i*5.0) )
		set u = null
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		set t = CreateTrigger(  )
		call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT  )
		call TriggerAddCondition( t, Condition( function Trig_Medkit_Conditions ) )
		call TriggerAddAction( t, function Trig_Medkit_Actions )
	endfunction

endlibrary